package com.example.myapplication.item;


import ohos.agp.render.Canvas;
import ohos.agp.render.PixelMapHolder;
import ohos.media.image.PixelMap;

/**
 *Created by Miaolonglong on 2021/12/24.
 */

public class EnemyBullet extends Bullet {
    public EnemyBullet(PixelMapHolder bitmap) {
        super(bitmap);
    }

    @Override
    public void draw(Canvas canvas) {
        if (isMirror()) {
            canvas.save();
            //翻转画布 相当于翻转人物
            canvas.scale(-1, 1, getX() + getWidth() / 2, getY() + getHeight() / 2);
            super.draw(canvas);
            canvas.restore();
        } else {
            super.draw(canvas);

        }
    }

}
